import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class App {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        AccountService accountService = (AccountService) ctx.getBean("accountService");
//        Account id = accountService.findById(2);
//        System.out.println(id);
        /*Account account =new Account();
        account.setId(18);
        account.setName("小灰灰");
        account.setMoney(10000.520);
        accountService.save(account);*/

        List<Account> all = accountService.findAll();
        for (Account account : all) {
            System.out.println(account);
        }

    }
}
